class Ssp::User < ApplicationRecord
  acts_as_authentic do |config|
    config.login_field = :ssid
  end

  # SSTYPES = { '县级': 'country', '乡镇级': 'town', '村级': 'village' }
  SSTYPES = { '乡镇级服务站': 'town', '村级服务站': 'village' }
  validates_inclusion_of :sstype, in: SSTYPES.values, allow_nil: true

  def human_sstype
    SSTYPES.key sstype
  end

end
